'use strict'
import tape from 'tape'
import * as util from '../src/util'
import { ERC721 } from './data/ERC721'
import { sampleERC721 } from './data/sampleERC721'

tape('Util', function (t) {
  t.test('lowerbound', function (st) {
    st.plan(7)
    let array = [2, 5, 8, 9, 45, 56, 78]
    let lowerBound = util.findLowerBound(10, array)
    st.equal(lowerBound, 3)

    lowerBound = util.findLowerBound(3, array)
    st.equal(lowerBound, 0)

    lowerBound = util.findLowerBound(100, array)
    st.equal(lowerBound, 6)

    lowerBound = util.findLowerBound(1, array)
    st.equal(lowerBound, -1)

    lowerBound = util.findLowerBound(45, array)
    st.equal(lowerBound, 4)

    array = [2, 5, 8, 9, 9, 45, 56, 78]
    lowerBound = util.findLowerBound(9, array)
    st.equal(lowerBound, 4)

    lowerBound = util.findLowerBound(9, [])
    st.equal(lowerBound, -1)
  })
})

tape('util.groupBy on valid input', function (t) {
  t.plan(1)

  const result = util.groupBy([
    { category: 'GAS', name: 'a' },
    { category: 'SEC', name: 'b' },
    { category: 'GAS', name: 'c' }

  ], 'category')

  const expectedResult = {
    'GAS': [
      { category: 'GAS', name: 'a' },
      { category: 'GAS', name: 'c' }
    ],
    'SEC': [
      { category: 'SEC', name: 'b' }
    ]
  }

  t.deepEqual(result, expectedResult)
})

tape('util.concatWithSeparator valid output', function (t) {
  t.plan(4)
  t.notEqual(util.concatWithSeparator(['a', 'b', 'c'], ','), 'a, b, c', 'Concat with comma should not produce spaces')
  t.equal(util.concatWithSeparator(['a', 'b', 'c'], ','), 'a,b,c', 'Concat with comma should not produce spaces')
  t.equal(util.concatWithSeparator(['a', 'b', 'c'], ', '), 'a, b, c', 'Concat with comma space should not produce trailing comma')
  t.equal(util.concatWithSeparator(['a', 'b', 'c'], '+'), 'a+b+c', 'Concat with plus')
})

tape('util.escapeRegExp', function (t) {
  t.plan(3)
  const original = 'function (uint256) returns (bool)'
  t.equal(util.escapeRegExp('abcd'), 'abcd', 'String with no regex')
  t.equal(util.escapeRegExp(original), 'function \\(uint256\\) returns \\(bool\\)', 'function string with regex')
  t.ok(new RegExp(util.escapeRegExp(original)).test(original), 'should still test for original string')
})

tape('util.compareByteCode', function (t) {
  t.plan(5)

  const address = 'c2a9cef5420203c2672f0e4325cca774893cca98'
  const nullAddress = '0000000000000000000000000000000000000000'
  const deployedLibraryByteCode = '0x73c2a9cef5420203c2672f0e4325cca774893cca983014608060405260043610610058576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063f26ea02c1461005d575b600080fd5b81801561006957600080fd5b506100886004803603810190808035906020019092919050505061008a565b005b600081600101600060648110151561009e57fe5b600502016002018190555060008160010160006064811015156100bd57fe5b600502016004018190555060008160010160006064811015156100dc57fe5b6005020160030181905550600081600001819055506001816101f501819055816101f601819055506064816101f70181905550505600a165627a7a723058203a6f106db7413fd9cad962bc12ba2327799d6b1334335f7bb854eab04200b3bf0029'
  t.ok(util.compareByteCode(deployedLibraryByteCode, deployedLibraryByteCode.replace(address, nullAddress)), 'library bytecode should be the same')

  // ballot on ropsten - 0x96d87AB604AEC7FB26C2E046CA5e6eBBB9D8b74D
  const code1 = '0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063609ff1bd1161005b578063609ff1bd146101925780639e7b8d61146101b0578063a3ec138d146101f4578063e2ba53f01461029157610088565b80630121b93f1461008d578063013cf08b146100bb5780632e4176cf146101045780635c19a95c1461014e575b600080fd5b6100b9600480360360208110156100a357600080fd5b81019080803590602001909291905050506102af565b005b6100e7600480360360208110156100d157600080fd5b810190808035906020019092919050505061044c565b604051808381526020018281526020019250505060405180910390f35b61010c61047d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101906004803603602081101561016457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104a2565b005b61019a6108be565b6040518082815260200191505060405180910390f35b6101f2600480360360208110156101c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610935565b005b6102366004803603602081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b36565b60405180858152602001841515151581526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390f35b610299610b93565b6040518082815260200191505060405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000154141561036d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f486173206e6f20726967687420746f20766f746500000000000000000000000081525060200191505060405180910390fd5b8060010160009054906101000a900460ff16156103f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f416c726561647920766f7465642e00000000000000000000000000000000000081525060200191505060405180910390fd5b60018160010160006101000a81548160ff02191690831515021790555081816002018190555080600001546002838154811061042a57fe5b9060005260206000209060020201600101600082825401925050819055505050565b6002818154811061045957fe5b90600052602060002090600202016000915090508060000154908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff161561056a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f7520616c726561647920766f7465642e000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f53656c662d64656c65676174696f6e20697320646973616c6c6f7765642e000081525060200191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107af57600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156107aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f466f756e64206c6f6f7020696e2064656c65676174696f6e2e0000000000000081525060200191505060405180910390fd5b61060d565b60018160010160006101000a81548160ff021916908315150217905550818160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff16156108a2578160000154600282600201548154811061087f57fe5b9060005260206000209060020201600101600082825401925050819055506108b9565b816000015481600001600082825401925050819055505b505050565b6000806000905060008090505b6002805490508110156109305781600282815481106108e657fe5b9060005260206000209060020201600101541115610923576002818154811061090b57fe5b90600052602060002090600202016001015491508092505b80806001019150506108cb565b505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109da576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180610bc16028913960400191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff1615610a9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f54686520766f74657220616c726561647920766f7465642e000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414610aec57600080fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60016020528060005260406000206000915090508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154905084565b60006002610b9f6108be565b81548110610ba957fe5b90600052602060002090600202016000015490509056fe4f6e6c79206368616972706572736f6e2063616e206769766520726967687420746f20766f74652ea26469706673582212205c306dddac7a80542891873341cf580f3b5920b0374bd5e32fe35fcabb116aaa64736f6c63430006010033'
  const code2 = '0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063609ff1bd1161005b578063609ff1bd146101925780639e7b8d61146101b0578063a3ec138d146101f4578063e2ba53f01461029157610088565b80630121b93f1461008d578063013cf08b146100bb5780632e4176cf146101045780635c19a95c1461014e575b600080fd5b6100b9600480360360208110156100a357600080fd5b81019080803590602001909291905050506102af565b005b6100e7600480360360208110156100d157600080fd5b810190808035906020019092919050505061044c565b604051808381526020018281526020019250505060405180910390f35b61010c61047d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101906004803603602081101561016457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104a2565b005b61019a6108be565b6040518082815260200191505060405180910390f35b6101f2600480360360208110156101c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610935565b005b6102366004803603602081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b36565b60405180858152602001841515151581526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390f35b610299610b93565b6040518082815260200191505060405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000154141561036d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f486173206e6f20726967687420746f20766f746500000000000000000000000081525060200191505060405180910390fd5b8060010160009054906101000a900460ff16156103f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f416c726561647920766f7465642e00000000000000000000000000000000000081525060200191505060405180910390fd5b60018160010160006101000a81548160ff02191690831515021790555081816002018190555080600001546002838154811061042a57fe5b9060005260206000209060020201600101600082825401925050819055505050565b6002818154811061045957fe5b90600052602060002090600202016000915090508060000154908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff161561056a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f7520616c726561647920766f7465642e000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f53656c662d64656c65676174696f6e20697320646973616c6c6f7765642e000081525060200191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107af57600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156107aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f466f756e64206c6f6f7020696e2064656c65676174696f6e2e0000000000000081525060200191505060405180910390fd5b61060d565b60018160010160006101000a81548160ff021916908315150217905550818160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff16156108a2578160000154600282600201548154811061087f57fe5b9060005260206000209060020201600101600082825401925050819055506108b9565b816000015481600001600082825401925050819055505b505050565b6000806000905060008090505b6002805490508110156109305781600282815481106108e657fe5b9060005260206000209060020201600101541115610923576002818154811061090b57fe5b90600052602060002090600202016001015491508092505b80806001019150506108cb565b505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109da576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180610bc16028913960400191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff1615610a9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f54686520766f74657220616c726561647920766f7465642e000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414610aec57600080fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60016020528060005260406000206000915090508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154905084565b60006002610b9f6108be565b81548110610ba957fe5b90600052602060002090600202016000015490509056fe4f6e6c79206368616972706572736f6e2063616e206769766520726967687420746f20766f74652ea26469706673582212207f175eb02901e2002e7a57d5736c3bea18bac88a3602e809c170e4a0da9dbf8d64736f6c63430006010033'
  t.ok(util.compareByteCode(code1, code2), 'should match even though cbor encoded metadatas are different')

  const storageCode1 = '0x608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100d9565b60405180910390f35b610073600480360381019061006e919061009d565b61007e565b005b60008054905090565b8060008190555050565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea2646970667358221220c29dfcfdfd91e29bbf21ece97752e17fd3a0c07db30320f5b60b087866d2b7b164736f6c63430008070033'
  const storageCode2 = '0x608060405234801561001057600080fd5b506101e8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100ec565b60405180910390f35b610073600480360381019061006e91906100b0565b61007e565b005b60008054905090565b6000602a90506001826100919190610107565b6000819055505050565b6000813590506100aa8161019b565b92915050565b6000602082840312156100c6576100c5610196565b5b60006100d48482850161009b565b91505092915050565b6100e68161015d565b82525050565b600060208201905061010160008301846100dd565b92915050565b60006101128261015d565b915061011d8361015d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561015257610151610167565b5b828201905092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b6101a48161015d565b81146101af57600080fd5b5056fea264697066735822122096fdfc54e6f9b12cf7a0e5d49289e40f3e9ed7554a1e5485cff008aebc78f27264736f6c63430008070033'
  t.ok(!util.compareByteCode(storageCode1, storageCode2), 'should not match')

  t.ok(!util.compareByteCode(sampleERC721, ERC721), 'should not match')

  const immutableRef1 = '0x6080604052600436106101145760003560e01c806352d1902d116100a057806395d89b411161006457806395d89b4114610380578063a457c2d7146103ab578063a9059cbb146103e8578063dd62ed3e14610425578063f2fde38b1461046257610114565b806352d1902d146102bf57806370a08231146102ea578063715018a6146103275780638129fc1c1461033e5780638da5cb5b1461035557610114565b8063313ce567116100e7578063313ce567146101e95780633659cfe614610214578063395093511461023d57806340c10f191461027a5780634f1ef286146102a357610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac575b600080fd5b34801561012557600080fd5b5061012e61048b565b60405161013b919061228a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611e3d565b61051d565b6040516101789190612239565b60405180910390f35b34801561018d57600080fd5b50610196610540565b6040516101a3919061250c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190611d8e565b61054a565b6040516101e09190612239565b60405180910390f35b3480156101f557600080fd5b506101fe610579565b60405161020b9190612527565b60405180910390f35b34801561022057600080fd5b5061023b60048036038101906102369190611d21565b610582565b005b34801561024957600080fd5b50610264600480360381019061025f9190611e3d565b61070b565b6040516102719190612239565b60405180910390f35b34801561028657600080fd5b506102a1600480360381019061029c9190611e3d565b610742565b005b6102bd60048036038101906102b89190611de1565b610758565b005b3480156102cb57600080fd5b506102d4610895565b6040516102e19190612254565b60405180910390f35b3480156102f657600080fd5b50610311600480360381019061030c9190611d21565b61094e565b60405161031e919061250c565b60405180910390f35b34801561033357600080fd5b5061033c610997565b005b34801561034a57600080fd5b506103536109ab565b005b34801561036157600080fd5b5061036a610b65565b604051610377919061221e565b60405180910390f35b34801561038c57600080fd5b50610395610b8f565b6040516103a2919061228a565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190611e3d565b610c21565b6040516103df9190612239565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a9190611e3d565b610c98565b60405161041c9190612239565b60405180910390f35b34801561043157600080fd5b5061044c60048036038101906104479190611d4e565b610cbb565b604051610459919061250c565b60405180910390f35b34801561046e57600080fd5b5061048960048036038101906104849190611d21565b610d42565b005b60606036805461049a906126d3565b80601f01602080910402602001604051908101604052809291908181526020018280546104c6906126d3565b80156105135780601f106104e857610100808354040283529160200191610513565b820191906000526020600020905b8154815290600101906020018083116104f657829003601f168201915b5050505050905090565b600080610528610dc6565b9050610535818585610dce565b600191505092915050565b6000603554905090565b600080610555610dc6565b9050610562858285610f99565b61056d858585611025565b60019150509392505050565b60006012905090565b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610611576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106089061230c565b60405180910390fd5b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff166106506112a0565b73ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d9061236c565b60405180910390fd5b6106af816112f7565b61070881600067ffffffffffffffff8111156106ce576106cd612794565b5b6040519080825280601f01601f1916602001820160405280156107005781602001600182028036833780820191505090505b506000611302565b50565b600080610716610dc6565b90506107378185856107288589610cbb565b61073291906125ca565b610dce565b600191505092915050565b61074a61147f565b61075482826114fd565b5050565b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de9061230c565b60405180910390fd5b7f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff166108266112a0565b73ffffffffffffffffffffffffffffffffffffffff161461087c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108739061236c565b60405180910390fd5b610885826112f7565b61089182826001611302565b5050565b60007f000000000000000000000000d9145cce52d386f254917e481eb44e9943f3913873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c9061238c565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b6000603360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099f61147f565b6109a96000611655565b565b60008060019054906101000a900460ff161590508080156109dc5750600160008054906101000a900460ff1660ff16105b80610a0957506109eb3061171b565b158015610a085750600160008054906101000a900460ff1660ff16145b5b610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3f906123cc565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610a85576001600060016101000a81548160ff0219169083151502179055505b610af96040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525061173e565b610b0161179b565b610b096117f4565b8015610b625760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610b59919061226f565b60405180910390a15b50565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060378054610b9e906126d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610bca906126d3565b8015610c175780601f10610bec57610100808354040283529160200191610c17565b820191906000526020600020905b815481529060010190602001808311610bfa57829003601f168201915b5050505050905090565b600080610c2c610dc6565b90506000610c3a8286610cbb565b905083811015610c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c76906124cc565b60405180910390fd5b610c8c8286868403610dce565b60019250505092915050565b600080610ca3610dc6565b9050610cb0818585611025565b600191505092915050565b6000603460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4a61147f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db1906122cc565b60405180910390fd5b610dc381611655565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e359061248c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea5906122ec565b60405180910390fd5b80603460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f8c919061250c565b60405180910390a3505050565b6000610fa58484610cbb565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461101f5781811015611011576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110089061232c565b60405180910390fd5b61101e8484848403610dce565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c9061246c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc906122ac565b60405180910390fd5b611110838383611845565b6000603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118e9061234c565b60405180910390fd5b818103603360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611287919061250c565b60405180910390a361129a84848461184a565b50505050565b60006112ce7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112ff61147f565b50565b61132e7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b611859565b60000160009054906101000a900460ff16156113525761134d83611863565b61147a565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561139857600080fd5b505afa9250505080156113c957506040513d601f19601f820116820180604052508101906113c69190611e7d565b60015b611408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ff906123ec565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461146d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611464906123ac565b60405180910390fd5b5061147983838361191c565b5b505050565b611487610dc6565b73ffffffffffffffffffffffffffffffffffffffff166114a5610b65565b73ffffffffffffffffffffffffffffffffffffffff16146114fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f29061242c565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561156d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611564906124ec565b60405180910390fd5b61157960008383611845565b806035600082825461158b91906125ca565b9250508190555080603360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161163d919061250c565b60405180910390a36116516000838361184a565b5050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661178d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611784906124ac565b60405180910390fd5b6117978282611948565b5050565b600060019054906101000a900460ff166117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e1906124ac565b60405180910390fd5b6117f26119c9565b565b600060019054906101000a900460ff16611843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183a906124ac565b60405180910390fd5b565b505050565b505050565b6000819050919050565b6000819050919050565b61186c8161171b565b6118ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a29061240c565b60405180910390fd5b806118d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61192583611a2a565b6000825111806119325750805b15611943576119418383611a79565b505b505050565b600060019054906101000a900460ff16611997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198e906124ac565b60405180910390fd5b81603690805190602001906119ad929190611bcf565b5080603790805190602001906119c4929190611bcf565b505050565b600060019054906101000a900460ff16611a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0f906124ac565b60405180910390fd5b611a28611a23610dc6565b611655565b565b611a3381611863565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060611a848361171b565b611ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aba9061244c565b60405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1684604051611aeb9190612207565b600060405180830381855af49150503d8060008114611b26576040519150601f19603f3d011682016040523d82523d6000602084013e611b2b565b606091505b5091509150611b538282604051806060016040528060278152602001612d9960279139611b5d565b9250505092915050565b60608315611b6d57829050611b78565b611b778383611b7f565b5b9392505050565b600082511115611b925781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc6919061228a565b60405180910390fd5b828054611bdb906126d3565b90600052602060002090601f016020900481019282611bfd5760008555611c44565b82601f10611c1657805160ff1916838001178555611c44565b82800160010185558215611c44579182015b82811115611c43578251825591602001919060010190611c28565b5b509050611c519190611c55565b5090565b5b80821115611c6e576000816000905550600101611c56565b5090565b6000611c85611c8084612567565b612542565b905082815260208101848484011115611ca157611ca06127c8565b5b611cac848285612691565b509392505050565b600081359050611cc381612d53565b92915050565b600081519050611cd881612d6a565b92915050565b600082601f830112611cf357611cf26127c3565b5b8135611d03848260208601611c72565b91505092915050565b600081359050611d1b81612d81565b92915050565b600060208284031215611d3757611d366127d2565b5b6000611d4584828501611cb4565b91505092915050565b60008060408385031215611d6557611d646127d2565b5b6000611d7385828601611cb4565b9250506020611d8485828601611cb4565b9150509250929050565b600080600060608486031215611da757611da66127d2565b5b6000611db586828701611cb4565b9350506020611dc686828701611cb4565b9250506040611dd786828701611d0c565b9150509250925092565b60008060408385031215611df857611df76127d2565b5b6000611e0685828601611cb4565b925050602083013567ffffffffffffffff811115611e2757611e266127cd565b5b611e3385828601611cde565b9150509250929050565b60008060408385031215611e5457611e536127d2565b5b6000611e6285828601611cb4565b9250506020611e7385828601611d0c565b9150509250929050565b600060208284031215611e9357611e926127d2565b5b6000611ea184828501611cc9565b91505092915050565b611eb381612620565b82525050565b611ec281612632565b82525050565b611ed18161263e565b82525050565b6000611ee282612598565b611eec81856125ae565b9350611efc8185602086016126a0565b80840191505092915050565b611f118161267f565b82525050565b6000611f22826125a3565b611f2c81856125b9565b9350611f3c8185602086016126a0565b611f45816127d7565b840191505092915050565b6000611f5d6023836125b9565b9150611f68826127e8565b604082019050919050565b6000611f806026836125b9565b9150611f8b82612837565b604082019050919050565b6000611fa36022836125b9565b9150611fae82612886565b604082019050919050565b6000611fc6602c836125b9565b9150611fd1826128d5565b604082019050919050565b6000611fe9601d836125b9565b9150611ff482612924565b602082019050919050565b600061200c6026836125b9565b91506120178261294d565b604082019050919050565b600061202f602c836125b9565b915061203a8261299c565b604082019050919050565b60006120526038836125b9565b915061205d826129eb565b604082019050919050565b60006120756029836125b9565b915061208082612a3a565b604082019050919050565b6000612098602e836125b9565b91506120a382612a89565b604082019050919050565b60006120bb602e836125b9565b91506120c682612ad8565b604082019050919050565b60006120de602d836125b9565b91506120e982612b27565b604082019050919050565b60006121016020836125b9565b915061210c82612b76565b602082019050919050565b60006121246026836125b9565b915061212f82612b9f565b604082019050919050565b60006121476025836125b9565b915061215282612bee565b604082019050919050565b600061216a6024836125b9565b915061217582612c3d565b604082019050919050565b600061218d602b836125b9565b915061219882612c8c565b604082019050919050565b60006121b06025836125b9565b91506121bb82612cdb565b604082019050919050565b60006121d3601f836125b9565b91506121de82612d2a565b602082019050919050565b6121f281612668565b82525050565b61220181612672565b82525050565b60006122138284611ed7565b915081905092915050565b60006020820190506122336000830184611eaa565b92915050565b600060208201905061224e6000830184611eb9565b92915050565b60006020820190506122696000830184611ec8565b92915050565b60006020820190506122846000830184611f08565b92915050565b600060208201905081810360008301526122a48184611f17565b905092915050565b600060208201905081810360008301526122c581611f50565b9050919050565b600060208201905081810360008301526122e581611f73565b9050919050565b6000602082019050818103600083015261230581611f96565b9050919050565b6000602082019050818103600083015261232581611fb9565b9050919050565b6000602082019050818103600083015261234581611fdc565b9050919050565b6000602082019050818103600083015261236581611fff565b9050919050565b6000602082019050818103600083015261238581612022565b9050919050565b600060208201905081810360008301526123a581612045565b9050919050565b600060208201905081810360008301526123c581612068565b9050919050565b600060208201905081810360008301526123e58161208b565b9050919050565b60006020820190508181036000830152612405816120ae565b9050919050565b60006020820190508181036000830152612425816120d1565b9050919050565b60006020820190508181036000830152612445816120f4565b9050919050565b6000602082019050818103600083015261246581612117565b9050919050565b600060208201905081810360008301526124858161213a565b9050919050565b600060208201905081810360008301526124a58161215d565b9050919050565b600060208201905081810360008301526124c581612180565b9050919050565b600060208201905081810360008301526124e5816121a3565b9050919050565b60006020820190508181036000830152612505816121c6565b9050919050565b600060208201905061252160008301846121e9565b92915050565b600060208201905061253c60008301846121f8565b92915050565b600061254c61255d565b90506125588282612705565b919050565b6000604051905090565b600067ffffffffffffffff82111561258257612581612794565b5b61258b826127d7565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006125d582612668565b91506125e083612668565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561261557612614612736565b5b828201905092915050565b600061262b82612648565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061268a82612672565b9050919050565b82818337600083830152505050565b60005b838110156126be5780820151818401526020810190506126a3565b838111156126cd576000848401525b50505050565b600060028204905060018216806126eb57607f821691505b602082108114156126ff576126fe612765565b5b50919050565b61270e826127d7565b810181811067ffffffffffffffff8211171561272d5761272c612794565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b612d5c81612620565b8114612d6757600080fd5b50565b612d738161263e565b8114612d7e57600080fd5b50565b612d8a81612668565b8114612d9557600080fd5b5056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066b4ca7b81ce7dbc6af77b0a062c617f3c53c6ec81d80662160ff3cdcd358a8064736f6c63430008070033'
  const immutableRef2 = '0x6080604052600436106101145760003560e01c806352d1902d116100a057806395d89b411161006457806395d89b4114610380578063a457c2d7146103ab578063a9059cbb146103e8578063dd62ed3e14610425578063f2fde38b1461046257610114565b806352d1902d146102bf57806370a08231146102ea578063715018a6146103275780638129fc1c1461033e5780638da5cb5b1461035557610114565b8063313ce567116100e7578063313ce567146101e95780633659cfe614610214578063395093511461023d57806340c10f191461027a5780634f1ef286146102a357610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac575b600080fd5b34801561012557600080fd5b5061012e61048b565b60405161013b919061228a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611e3d565b61051d565b6040516101789190612239565b60405180910390f35b34801561018d57600080fd5b50610196610540565b6040516101a3919061250c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190611d8e565b61054a565b6040516101e09190612239565b60405180910390f35b3480156101f557600080fd5b506101fe610579565b60405161020b9190612527565b60405180910390f35b34801561022057600080fd5b5061023b60048036038101906102369190611d21565b610582565b005b34801561024957600080fd5b50610264600480360381019061025f9190611e3d565b61070b565b6040516102719190612239565b60405180910390f35b34801561028657600080fd5b506102a1600480360381019061029c9190611e3d565b610742565b005b6102bd60048036038101906102b89190611de1565b610758565b005b3480156102cb57600080fd5b506102d4610895565b6040516102e19190612254565b60405180910390f35b3480156102f657600080fd5b50610311600480360381019061030c9190611d21565b61094e565b60405161031e919061250c565b60405180910390f35b34801561033357600080fd5b5061033c610997565b005b34801561034a57600080fd5b506103536109ab565b005b34801561036157600080fd5b5061036a610b65565b604051610377919061221e565b60405180910390f35b34801561038c57600080fd5b50610395610b8f565b6040516103a2919061228a565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190611e3d565b610c21565b6040516103df9190612239565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a9190611e3d565b610c98565b60405161041c9190612239565b60405180910390f35b34801561043157600080fd5b5061044c60048036038101906104479190611d4e565b610cbb565b604051610459919061250c565b60405180910390f35b34801561046e57600080fd5b5061048960048036038101906104849190611d21565b610d42565b005b60606036805461049a906126d3565b80601f01602080910402602001604051908101604052809291908181526020018280546104c6906126d3565b80156105135780601f106104e857610100808354040283529160200191610513565b820191906000526020600020905b8154815290600101906020018083116104f657829003601f168201915b5050505050905090565b600080610528610dc6565b9050610535818585610dce565b600191505092915050565b6000603554905090565b600080610555610dc6565b9050610562858285610f99565b61056d858585611025565b60019150509392505050565b60006012905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610611576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106089061230c565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166106506112a0565b73ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d9061236c565b60405180910390fd5b6106af816112f7565b61070881600067ffffffffffffffff8111156106ce576106cd612794565b5b6040519080825280601f01601f1916602001820160405280156107005781602001600182028036833780820191505090505b506000611302565b50565b600080610716610dc6565b90506107378185856107288589610cbb565b61073291906125ca565b610dce565b600191505092915050565b61074a61147f565b61075482826114fd565b5050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de9061230c565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108266112a0565b73ffffffffffffffffffffffffffffffffffffffff161461087c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108739061236c565b60405180910390fd5b610885826112f7565b61089182826001611302565b5050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c9061238c565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b6000603360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099f61147f565b6109a96000611655565b565b60008060019054906101000a900460ff161590508080156109dc5750600160008054906101000a900460ff1660ff16105b80610a0957506109eb3061171b565b158015610a085750600160008054906101000a900460ff1660ff16145b5b610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3f906123cc565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610a85576001600060016101000a81548160ff0219169083151502179055505b610af96040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525061173e565b610b0161179b565b610b096117f4565b8015610b625760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610b59919061226f565b60405180910390a15b50565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060378054610b9e906126d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610bca906126d3565b8015610c175780601f10610bec57610100808354040283529160200191610c17565b820191906000526020600020905b815481529060010190602001808311610bfa57829003601f168201915b5050505050905090565b600080610c2c610dc6565b90506000610c3a8286610cbb565b905083811015610c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c76906124cc565b60405180910390fd5b610c8c8286868403610dce565b60019250505092915050565b600080610ca3610dc6565b9050610cb0818585611025565b600191505092915050565b6000603460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4a61147f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db1906122cc565b60405180910390fd5b610dc381611655565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e359061248c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea5906122ec565b60405180910390fd5b80603460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f8c919061250c565b60405180910390a3505050565b6000610fa58484610cbb565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461101f5781811015611011576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110089061232c565b60405180910390fd5b61101e8484848403610dce565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c9061246c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc906122ac565b60405180910390fd5b611110838383611845565b6000603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118e9061234c565b60405180910390fd5b818103603360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081603360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611287919061250c565b60405180910390a361129a84848461184a565b50505050565b60006112ce7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112ff61147f565b50565b61132e7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b611859565b60000160009054906101000a900460ff16156113525761134d83611863565b61147a565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561139857600080fd5b505afa9250505080156113c957506040513d601f19601f820116820180604052508101906113c69190611e7d565b60015b611408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ff906123ec565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461146d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611464906123ac565b60405180910390fd5b5061147983838361191c565b5b505050565b611487610dc6565b73ffffffffffffffffffffffffffffffffffffffff166114a5610b65565b73ffffffffffffffffffffffffffffffffffffffff16146114fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f29061242c565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561156d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611564906124ec565b60405180910390fd5b61157960008383611845565b806035600082825461158b91906125ca565b9250508190555080603360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161163d919061250c565b60405180910390a36116516000838361184a565b5050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661178d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611784906124ac565b60405180910390fd5b6117978282611948565b5050565b600060019054906101000a900460ff166117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e1906124ac565b60405180910390fd5b6117f26119c9565b565b600060019054906101000a900460ff16611843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183a906124ac565b60405180910390fd5b565b505050565b505050565b6000819050919050565b6000819050919050565b61186c8161171b565b6118ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a29061240c565b60405180910390fd5b806118d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61184f565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61192583611a2a565b6000825111806119325750805b15611943576119418383611a79565b505b505050565b600060019054906101000a900460ff16611997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198e906124ac565b60405180910390fd5b81603690805190602001906119ad929190611bcf565b5080603790805190602001906119c4929190611bcf565b505050565b600060019054906101000a900460ff16611a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0f906124ac565b60405180910390fd5b611a28611a23610dc6565b611655565b565b611a3381611863565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060611a848361171b565b611ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aba9061244c565b60405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1684604051611aeb9190612207565b600060405180830381855af49150503d8060008114611b26576040519150601f19603f3d011682016040523d82523d6000602084013e611b2b565b606091505b5091509150611b538282604051806060016040528060278152602001612d9960279139611b5d565b9250505092915050565b60608315611b6d57829050611b78565b611b778383611b7f565b5b9392505050565b600082511115611b925781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc6919061228a565b60405180910390fd5b828054611bdb906126d3565b90600052602060002090601f016020900481019282611bfd5760008555611c44565b82601f10611c1657805160ff1916838001178555611c44565b82800160010185558215611c44579182015b82811115611c43578251825591602001919060010190611c28565b5b509050611c519190611c55565b5090565b5b80821115611c6e576000816000905550600101611c56565b5090565b6000611c85611c8084612567565b612542565b905082815260208101848484011115611ca157611ca06127c8565b5b611cac848285612691565b509392505050565b600081359050611cc381612d53565b92915050565b600081519050611cd881612d6a565b92915050565b600082601f830112611cf357611cf26127c3565b5b8135611d03848260208601611c72565b91505092915050565b600081359050611d1b81612d81565b92915050565b600060208284031215611d3757611d366127d2565b5b6000611d4584828501611cb4565b91505092915050565b60008060408385031215611d6557611d646127d2565b5b6000611d7385828601611cb4565b9250506020611d8485828601611cb4565b9150509250929050565b600080600060608486031215611da757611da66127d2565b5b6000611db586828701611cb4565b9350506020611dc686828701611cb4565b9250506040611dd786828701611d0c565b9150509250925092565b60008060408385031215611df857611df76127d2565b5b6000611e0685828601611cb4565b925050602083013567ffffffffffffffff811115611e2757611e266127cd565b5b611e3385828601611cde565b9150509250929050565b60008060408385031215611e5457611e536127d2565b5b6000611e6285828601611cb4565b9250506020611e7385828601611d0c565b9150509250929050565b600060208284031215611e9357611e926127d2565b5b6000611ea184828501611cc9565b91505092915050565b611eb381612620565b82525050565b611ec281612632565b82525050565b611ed18161263e565b82525050565b6000611ee282612598565b611eec81856125ae565b9350611efc8185602086016126a0565b80840191505092915050565b611f118161267f565b82525050565b6000611f22826125a3565b611f2c81856125b9565b9350611f3c8185602086016126a0565b611f45816127d7565b840191505092915050565b6000611f5d6023836125b9565b9150611f68826127e8565b604082019050919050565b6000611f806026836125b9565b9150611f8b82612837565b604082019050919050565b6000611fa36022836125b9565b9150611fae82612886565b604082019050919050565b6000611fc6602c836125b9565b9150611fd1826128d5565b604082019050919050565b6000611fe9601d836125b9565b9150611ff482612924565b602082019050919050565b600061200c6026836125b9565b91506120178261294d565b604082019050919050565b600061202f602c836125b9565b915061203a8261299c565b604082019050919050565b60006120526038836125b9565b915061205d826129eb565b604082019050919050565b60006120756029836125b9565b915061208082612a3a565b604082019050919050565b6000612098602e836125b9565b91506120a382612a89565b604082019050919050565b60006120bb602e836125b9565b91506120c682612ad8565b604082019050919050565b60006120de602d836125b9565b91506120e982612b27565b604082019050919050565b60006121016020836125b9565b915061210c82612b76565b602082019050919050565b60006121246026836125b9565b915061212f82612b9f565b604082019050919050565b60006121476025836125b9565b915061215282612bee565b604082019050919050565b600061216a6024836125b9565b915061217582612c3d565b604082019050919050565b600061218d602b836125b9565b915061219882612c8c565b604082019050919050565b60006121b06025836125b9565b91506121bb82612cdb565b604082019050919050565b60006121d3601f836125b9565b91506121de82612d2a565b602082019050919050565b6121f281612668565b82525050565b61220181612672565b82525050565b60006122138284611ed7565b915081905092915050565b60006020820190506122336000830184611eaa565b92915050565b600060208201905061224e6000830184611eb9565b92915050565b60006020820190506122696000830184611ec8565b92915050565b60006020820190506122846000830184611f08565b92915050565b600060208201905081810360008301526122a48184611f17565b905092915050565b600060208201905081810360008301526122c581611f50565b9050919050565b600060208201905081810360008301526122e581611f73565b9050919050565b6000602082019050818103600083015261230581611f96565b9050919050565b6000602082019050818103600083015261232581611fb9565b9050919050565b6000602082019050818103600083015261234581611fdc565b9050919050565b6000602082019050818103600083015261236581611fff565b9050919050565b6000602082019050818103600083015261238581612022565b9050919050565b600060208201905081810360008301526123a581612045565b9050919050565b600060208201905081810360008301526123c581612068565b9050919050565b600060208201905081810360008301526123e58161208b565b9050919050565b60006020820190508181036000830152612405816120ae565b9050919050565b60006020820190508181036000830152612425816120d1565b9050919050565b60006020820190508181036000830152612445816120f4565b9050919050565b6000602082019050818103600083015261246581612117565b9050919050565b600060208201905081810360008301526124858161213a565b9050919050565b600060208201905081810360008301526124a58161215d565b9050919050565b600060208201905081810360008301526124c581612180565b9050919050565b600060208201905081810360008301526124e5816121a3565b9050919050565b60006020820190508181036000830152612505816121c6565b9050919050565b600060208201905061252160008301846121e9565b92915050565b600060208201905061253c60008301846121f8565b92915050565b600061254c61255d565b90506125588282612705565b919050565b6000604051905090565b600067ffffffffffffffff82111561258257612581612794565b5b61258b826127d7565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006125d582612668565b91506125e083612668565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561261557612614612736565b5b828201905092915050565b600061262b82612648565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061268a82612672565b9050919050565b82818337600083830152505050565b60005b838110156126be5780820151818401526020810190506126a3565b838111156126cd576000848401525b50505050565b600060028204905060018216806126eb57607f821691505b602082108114156126ff576126fe612765565b5b50919050565b61270e826127d7565b810181811067ffffffffffffffff8211171561272d5761272c612794565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b612d5c81612620565b8114612d6757600080fd5b50565b612d738161263e565b8114612d7e57600080fd5b50565b612d8a81612668565b8114612d9557600080fd5b5056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066b4ca7b81ce7dbc6af77b0a062c617f3c53c6ec81d80662160ff3cdcd358a8064736f6c63430008070033'
  t.ok(util.compareByteCode(immutableRef1, immutableRef2), 'code contains immutable refs and should match')

})

tape('util.getInputParameters', function (t) {
  t.plan(2)

  t.equal(util.getinputParameters(sampleERC721), '000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016500000000000000000000000000000000000000000000000000000000000000')
  t.equal(util.getinputParameters(ERC721), '')
})

tape('util.compareByteCode uniswap onchain vs solidity local compilation result', function (t) {
  t.plan(1)
  t.ok(util.compareByteCode(uniswapQuote1, uniswapQuote2), 'uniswap bytecode should be the same')
})

const uniswapQuote2 = `0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063c45a01551161005b578063c45a0155146100d3578063cdca1753146100db578063f7729d43146100ee578063fa461e33146101015761007d565b80632f80bb1d1461008257806330d07f21146100ab5780634aa4a4fc146100be575b600080fd5b610095610090366004610e9e565b610116565b6040516100a29190611148565b60405180910390f35b6100956100b9366004610e30565b61017b565b6100c6610340565b6040516100a29190611084565b6100c6610364565b6100956100e9366004610e9e565b610388565b6100956100fc366004610e30565b6103d6565b61011461010f366004610f04565b610555565b005b60005b600061012484610660565b9050600080600061013487610668565b92509250925061014882848389600061017b565b955083156101605761015987610699565b965061016c565b85945050505050610175565b50505050610119565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff808616878216109083166101a65760008490555b6101b18787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836101d78861070c565b60000373ffffffffffffffffffffffffffffffffffffffff8816156101fc5787610222565b8561021b5773fffd8963efd1fc6a506488495d951d5263988d25610222565b6401000276a45b8b8b8e6040516020016102379392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016102669594939291906110a5565b6040805180830381600087803b15801561027f57600080fd5b505af19250505080156102cd575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102ca91810190610ee1565b60015b610333573d8080156102fb576040519150601f19603f3d011682016040523d82523d6000602084013e610300565b606091505b5073ffffffffffffffffffffffffffffffffffffffff841661032157600080555b61032a8161073e565b92505050610337565b5050505b95945050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60005b600061039684610660565b905060008060006103a687610668565b9250925092506103ba8383838960006103d6565b95508315610160576103cb87610699565b96505050505061038b565b600073ffffffffffffffffffffffffffffffffffffffff808616908716106103ff8787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836104258861070c565b73ffffffffffffffffffffffffffffffffffffffff881615610447578761046d565b856104665773fffd8963efd1fc6a506488495d951d5263988d2561046d565b6401000276a45b8c8b8d6040516020016104829392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016104b19594939291906110a5565b6040805180830381600087803b1580156104ca57600080fd5b505af1925050508015610518575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261051591810190610ee1565b60015b610333573d808015610546576040519150601f19603f3d011682016040523d82523d6000602084013e61054b565b606091505b5061032a8161073e565b60008313806105645750600082135b61056d57600080fd5b600080600061057b84610668565b9250925092506105ad7f00000000000000000000000000000000000000000000000000000000000000008484846107ef565b5060008060008089136105f3578573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610888a600003610628565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161089896000035b925092509250821561063f57604051818152602081fd5b6000541561065557600054811461065557600080fd5b604051828152602081fd5b516042111590565b600080806106768482610805565b9250610683846014610905565b9050610690846017610805565b91509193909250565b80516060906101759083906017907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9016109f5565b60006107047f00000000000000000000000000000000000000000000000000000000000000006106ff868686610bdc565b610c59565b949350505050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061073a57600080fd5b5090565b600081516020146107db5760448251101561078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078590611111565b60405180910390fd5b600482019150818060200190518101906107a89190610f52565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078591906110f7565b818060200190518101906101759190610fbc565b600061033785610800868686610bdc565b610d8f565b60008182601401101561087957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f746f416464726573735f6f766572666c6f770000000000000000000000000000604482015290519081900360640190fd5b81601401835110156108ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f416464726573735f6f75744f66426f756e64730000000000000000000000604482015290519081900360640190fd5b5001602001516c01000000000000000000000000900490565b60008182600301101561097957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f746f55696e7432345f6f766572666c6f77000000000000000000000000000000604482015290519081900360640190fd5b81600301835110156109ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f746f55696e7432345f6f75744f66426f756e6473000000000000000000000000604482015290519081900360640190fd5b50016003015190565b60608182601f011015610a6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b828284011015610ada57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b81830184511015610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015290519081900360640190fd5b606082158015610b6b5760405191506000825260208201604052610bd3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610ba4578051835260209283019201610b8c565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b610be4610dbf565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115610c1c579192915b506040805160608101825273ffffffffffffffffffffffffffffffffffffffff948516815292909316602083015262ffffff169181019190915290565b6000816020015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1610610c9b57600080fd5b508051602080830151604093840151845173ffffffffffffffffffffffffffffffffffffffff94851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301207fff0000000000000000000000000000000000000000000000000000000000000060a085015294901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b6000610d9b8383610c59565b90503373ffffffffffffffffffffffffffffffffffffffff82161461017557600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610def578081fd5b8135610e02610dfd82611175565b611151565b818152846020838601011115610e16578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a08688031215610e47578081fd5b8535610e52816111e5565b94506020860135610e62816111e5565b9350604086013562ffffff81168114610e79578182fd5b9250606086013591506080860135610e90816111e5565b809150509295509295909350565b60008060408385031215610eb0578182fd5b823567ffffffffffffffff811115610ec6578283fd5b610ed285828601610ddf565b95602094909401359450505050565b60008060408385031215610ef3578182fd5b505080516020909101519092909150565b600080600060608486031215610f18578283fd5b8335925060208401359150604084013567ffffffffffffffff811115610f3c578182fd5b610f4886828701610ddf565b9150509250925092565b600060208284031215610f63578081fd5b815167ffffffffffffffff811115610f79578182fd5b8201601f81018413610f89578182fd5b8051610f97610dfd82611175565b818152856020838501011115610fab578384fd5b6103378260208301602086016111b5565b600060208284031215610fcd578081fd5b5051919050565b60008151808452610fec8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b606093841b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000908116825260e89390931b7fffffff0000000000000000000000000000000000000000000000000000000000166014820152921b166017820152602b0190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a060808301526110ec60a0830184610fd4565b979650505050505050565b60006020825261110a6020830184610fd4565b9392505050565b60208082526010908201527f556e6578706563746564206572726f7200000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461120757600080fd5b5056fea26469706673582212204ba294eca0a366d4d8601eaa80323cb403aa01c4f4d2454757678b73f2acd97c64736f6c63430007060033`

const uniswapQuote1 = `0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063c45a01551161005b578063c45a0155146100d3578063cdca1753146100db578063f7729d43146100ee578063fa461e33146101015761007d565b80632f80bb1d1461008257806330d07f21146100ab5780634aa4a4fc146100be575b600080fd5b610095610090366004610e9e565b610116565b6040516100a29190611148565b60405180910390f35b6100956100b9366004610e30565b61017b565b6100c6610340565b6040516100a29190611084565b6100c6610364565b6100956100e9366004610e9e565b610388565b6100956100fc366004610e30565b6103d6565b61011461010f366004610f04565b610555565b005b60005b600061012484610660565b9050600080600061013487610668565b92509250925061014882848389600061017b565b955083156101605761015987610699565b965061016c565b85945050505050610175565b50505050610119565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff808616878216109083166101a65760008490555b6101b18787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836101d78861070c565b60000373ffffffffffffffffffffffffffffffffffffffff8816156101fc5787610222565b8561021b5773fffd8963efd1fc6a506488495d951d5263988d25610222565b6401000276a45b8b8b8e6040516020016102379392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016102669594939291906110a5565b6040805180830381600087803b15801561027f57600080fd5b505af19250505080156102cd575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102ca91810190610ee1565b60015b610333573d8080156102fb576040519150601f19603f3d011682016040523d82523d6000602084013e610300565b606091505b5073ffffffffffffffffffffffffffffffffffffffff841661032157600080555b61032a8161073e565b92505050610337565b5050505b95945050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98481565b60005b600061039684610660565b905060008060006103a687610668565b9250925092506103ba8383838960006103d6565b95508315610160576103cb87610699565b96505050505061038b565b600073ffffffffffffffffffffffffffffffffffffffff808616908716106103ff8787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836104258861070c565b73ffffffffffffffffffffffffffffffffffffffff881615610447578761046d565b856104665773fffd8963efd1fc6a506488495d951d5263988d2561046d565b6401000276a45b8c8b8d6040516020016104829392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016104b19594939291906110a5565b6040805180830381600087803b1580156104ca57600080fd5b505af1925050508015610518575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261051591810190610ee1565b60015b610333573d808015610546576040519150601f19603f3d011682016040523d82523d6000602084013e61054b565b606091505b5061032a8161073e565b60008313806105645750600082135b61056d57600080fd5b600080600061057b84610668565b9250925092506105ad7f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f9848484846107ef565b5060008060008089136105f3578573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610888a600003610628565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161089896000035b925092509250821561063f57604051818152602081fd5b6000541561065557600054811461065557600080fd5b604051828152602081fd5b516042111590565b600080806106768482610805565b9250610683846014610905565b9050610690846017610805565b91509193909250565b80516060906101759083906017907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9016109f5565b60006107047f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f9846106ff868686610bdc565b610c59565b949350505050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061073a57600080fd5b5090565b600081516020146107db5760448251101561078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078590611111565b60405180910390fd5b600482019150818060200190518101906107a89190610f52565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078591906110f7565b818060200190518101906101759190610fbc565b600061033785610800868686610bdc565b610d8f565b60008182601401101561087957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f746f416464726573735f6f766572666c6f770000000000000000000000000000604482015290519081900360640190fd5b81601401835110156108ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f416464726573735f6f75744f66426f756e64730000000000000000000000604482015290519081900360640190fd5b5001602001516c01000000000000000000000000900490565b60008182600301101561097957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f746f55696e7432345f6f766572666c6f77000000000000000000000000000000604482015290519081900360640190fd5b81600301835110156109ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f746f55696e7432345f6f75744f66426f756e6473000000000000000000000000604482015290519081900360640190fd5b50016003015190565b60608182601f011015610a6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b828284011015610ada57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b81830184511015610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015290519081900360640190fd5b606082158015610b6b5760405191506000825260208201604052610bd3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610ba4578051835260209283019201610b8c565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b610be4610dbf565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115610c1c579192915b506040805160608101825273ffffffffffffffffffffffffffffffffffffffff948516815292909316602083015262ffffff169181019190915290565b6000816020015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1610610c9b57600080fd5b508051602080830151604093840151845173ffffffffffffffffffffffffffffffffffffffff94851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301207fff0000000000000000000000000000000000000000000000000000000000000060a085015294901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b6000610d9b8383610c59565b90503373ffffffffffffffffffffffffffffffffffffffff82161461017557600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610def578081fd5b8135610e02610dfd82611175565b611151565b818152846020838601011115610e16578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a08688031215610e47578081fd5b8535610e52816111e5565b94506020860135610e62816111e5565b9350604086013562ffffff81168114610e79578182fd5b9250606086013591506080860135610e90816111e5565b809150509295509295909350565b60008060408385031215610eb0578182fd5b823567ffffffffffffffff811115610ec6578283fd5b610ed285828601610ddf565b95602094909401359450505050565b60008060408385031215610ef3578182fd5b505080516020909101519092909150565b600080600060608486031215610f18578283fd5b8335925060208401359150604084013567ffffffffffffffff811115610f3c578182fd5b610f4886828701610ddf565b9150509250925092565b600060208284031215610f63578081fd5b815167ffffffffffffffff811115610f79578182fd5b8201601f81018413610f89578182fd5b8051610f97610dfd82611175565b818152856020838501011115610fab578384fd5b6103378260208301602086016111b5565b600060208284031215610fcd578081fd5b5051919050565b60008151808452610fec8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b606093841b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000908116825260e89390931b7fffffff0000000000000000000000000000000000000000000000000000000000166014820152921b166017820152602b0190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a060808301526110ec60a0830184610fd4565b979650505050505050565b60006020825261110a6020830184610fd4565b9392505050565b60208082526010908201527f556e6578706563746564206572726f7200000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461120757600080fd5b5056fea164736f6c6343000706000a`

tape('util.compareByteCode which have input parameters', function (t) {
  t.plan(1)
  t.ok(util.compareByteCode(contractWithParameters, contractWithoutParameters), 'same contract but different parameters should still match "comparebytecode"')
})

const contractWithParameters = `0x608060405234801562000010575f80fd5b5060405162001756380380620017568339818101604052810190620000369190620001e7565b8160039081620000479190620004a1565b508060049081620000599190620004a1565b50505062000585565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b620000c3826200007b565b810181811067ffffffffffffffff82111715620000e557620000e46200008b565b5b80604052505050565b5f620000f962000062565b9050620001078282620000b8565b919050565b5f67ffffffffffffffff8211156200012957620001286200008b565b5b62000134826200007b565b9050602081019050919050565b5f5b838110156200016057808201518184015260208101905062000143565b5f8484015250505050565b5f620001816200017b846200010c565b620000ee565b905082815260208101848484011115620001a0576200019f62000077565b5b620001ad84828562000141565b509392505050565b5f82601f830112620001cc57620001cb62000073565b5b8151620001de8482602086016200016b565b91505092915050565b5f80604083850312156200020057620001ff6200006b565b5b5f83015167ffffffffffffffff81111562000220576200021f6200006f565b5b6200022e85828601620001b5565b925050602083015167ffffffffffffffff8111156200025257620002516200006f565b5b6200026085828601620001b5565b9150509250929050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680620002b957607f821691505b602082108103620002cf57620002ce62000274565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302620003337fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620002f6565b6200033f8683620002f6565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f62000389620003836200037d8462000357565b62000360565b62000357565b9050919050565b5f819050919050565b620003a48362000369565b620003bc620003b38262000390565b84845462000302565b825550505050565b5f90565b620003d2620003c4565b620003df81848462000399565b505050565b5b818110156200040657620003fa5f82620003c8565b600181019050620003e5565b5050565b601f82111562000455576200041f81620002d5565b6200042a84620002e7565b810160208510156200043a578190505b620004526200044985620002e7565b830182620003e4565b50505b505050565b5f82821c905092915050565b5f620004775f19846008026200045a565b1980831691505092915050565b5f62000491838362000466565b9150826002028217905092915050565b620004ac826200026a565b67ffffffffffffffff811115620004c857620004c76200008b565b5b620004d48254620002a1565b620004e18282856200040a565b5f60209050601f83116001811462000517575f841562000502578287015190505b6200050e858262000484565b8655506200057d565b601f1984166200052786620002d5565b5f5b82811015620005505784890151825560018201915060208501945060208101905062000529565b868310156200057057848901516200056c601f89168262000466565b8355505b6001600288020188555050505b505050505050565b6111c380620005935f395ff3fe608060405234801561000f575f80fd5b50600436106100a7575f3560e01c8063395093511161006f578063395093511461016557806370a082311461019557806395d89b41146101c5578063a457c2d7146101e3578063a9059cbb14610213578063dd62ed3e14610243576100a7565b806306fdde03146100ab578063095ea7b3146100c957806318160ddd146100f957806323b872dd14610117578063313ce56714610147575b5f80fd5b6100b3610273565b6040516100c09190610add565b60405180910390f35b6100e360048036038101906100de9190610b8e565b610303565b6040516100f09190610be6565b60405180910390f35b610101610325565b60405161010e9190610c0e565b60405180910390f35b610131600480360381019061012c9190610c27565b61032e565b60405161013e9190610be6565b60405180910390f35b61014f61035c565b60405161015c9190610c92565b60405180910390f35b61017f600480360381019061017a9190610b8e565b610364565b60405161018c9190610be6565b60405180910390f35b6101af60048036038101906101aa9190610cab565b61039a565b6040516101bc9190610c0e565b60405180910390f35b6101cd6103df565b6040516101da9190610add565b60405180910390f35b6101fd60048036038101906101f89190610b8e565b61046f565b60405161020a9190610be6565b60405180910390f35b61022d60048036038101906102289190610b8e565b6104e4565b60405161023a9190610be6565b60405180910390f35b61025d60048036038101906102589190610cd6565b610506565b60405161026a9190610c0e565b60405180910390f35b60606003805461028290610d41565b80601f01602080910402602001604051908101604052809291908181526020018280546102ae90610d41565b80156102f95780601f106102d0576101008083540402835291602001916102f9565b820191905f5260205f20905b8154815290600101906020018083116102dc57829003601f168201915b5050505050905090565b5f8061030d610588565b905061031a81858561058f565b600191505092915050565b5f600254905090565b5f80610338610588565b9050610345858285610752565b6103508585856107dd565b60019150509392505050565b5f6012905090565b5f8061036e610588565b905061038f8185856103808589610506565b61038a9190610d9e565b61058f565b600191505092915050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6060600480546103ee90610d41565b80601f016020809104026020016040519081016040528092919081815260200182805461041a90610d41565b80156104655780601f1061043c57610100808354040283529160200191610465565b820191905f5260205f20905b81548152906001019060200180831161044857829003601f168201915b5050505050905090565b5f80610479610588565b90505f6104868286610506565b9050838110156104cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c290610e41565b60405180910390fd5b6104d8828686840361058f565b60019250505092915050565b5f806104ee610588565b90506104fb8185856107dd565b600191505092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f490610ecf565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361066b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066290610f5d565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107459190610c0e565b60405180910390a3505050565b5f61075d8484610506565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107d757818110156107c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c090610fc5565b60405180910390fd5b6107d6848484840361058f565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084290611053565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b0906110e1565b60405180910390fd5b6108c4838383610a49565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610947576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093e9061116f565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a309190610c0e565b60405180910390a3610a43848484610a4e565b50505050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610a8a578082015181840152602081019050610a6f565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610aaf82610a53565b610ab98185610a5d565b9350610ac9818560208601610a6d565b610ad281610a95565b840191505092915050565b5f6020820190508181035f830152610af58184610aa5565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610b2a82610b01565b9050919050565b610b3a81610b20565b8114610b44575f80fd5b50565b5f81359050610b5581610b31565b92915050565b5f819050919050565b610b6d81610b5b565b8114610b77575f80fd5b50565b5f81359050610b8881610b64565b92915050565b5f8060408385031215610ba457610ba3610afd565b5b5f610bb185828601610b47565b9250506020610bc285828601610b7a565b9150509250929050565b5f8115159050919050565b610be081610bcc565b82525050565b5f602082019050610bf95f830184610bd7565b92915050565b610c0881610b5b565b82525050565b5f602082019050610c215f830184610bff565b92915050565b5f805f60608486031215610c3e57610c3d610afd565b5b5f610c4b86828701610b47565b9350506020610c5c86828701610b47565b9250506040610c6d86828701610b7a565b9150509250925092565b5f60ff82169050919050565b610c8c81610c77565b82525050565b5f602082019050610ca55f830184610c83565b92915050565b5f60208284031215610cc057610cbf610afd565b5b5f610ccd84828501610b47565b91505092915050565b5f8060408385031215610cec57610ceb610afd565b5b5f610cf985828601610b47565b9250506020610d0a85828601610b47565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610d5857607f821691505b602082108103610d6b57610d6a610d14565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610da882610b5b565b9150610db383610b5b565b9250828201905080821115610dcb57610dca610d71565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f610e2b602583610a5d565b9150610e3682610dd1565b604082019050919050565b5f6020820190508181035f830152610e5881610e1f565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f610eb9602483610a5d565b9150610ec482610e5f565b604082019050919050565b5f6020820190508181035f830152610ee681610ead565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f610f47602283610a5d565b9150610f5282610eed565b604082019050919050565b5f6020820190508181035f830152610f7481610f3b565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f610faf601d83610a5d565b9150610fba82610f7b565b602082019050919050565b5f6020820190508181035f830152610fdc81610fa3565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f61103d602583610a5d565b915061104882610fe3565b604082019050919050565b5f6020820190508181035f83015261106a81611031565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6110cb602383610a5d565b91506110d682611071565b604082019050919050565b5f6020820190508181035f8301526110f8816110bf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f611159602683610a5d565b9150611164826110ff565b604082019050919050565b5f6020820190508181035f8301526111868161114d565b905091905056fea264697066735822122068e7088e2020b3a92aeb07338de801db3c8164bac57255e32c1c6a6614fdeabe64736f6c63430008150033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017900000000000000000000000000000000000000000000000000000000000000`

const contractWithoutParameters = `0x608060405234801562000010575f80fd5b5060405162001756380380620017568339818101604052810190620000369190620001e7565b8160039081620000479190620004a1565b508060049081620000599190620004a1565b50505062000585565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b620000c3826200007b565b810181811067ffffffffffffffff82111715620000e557620000e46200008b565b5b80604052505050565b5f620000f962000062565b9050620001078282620000b8565b919050565b5f67ffffffffffffffff8211156200012957620001286200008b565b5b62000134826200007b565b9050602081019050919050565b5f5b838110156200016057808201518184015260208101905062000143565b5f8484015250505050565b5f620001816200017b846200010c565b620000ee565b905082815260208101848484011115620001a0576200019f62000077565b5b620001ad84828562000141565b509392505050565b5f82601f830112620001cc57620001cb62000073565b5b8151620001de8482602086016200016b565b91505092915050565b5f80604083850312156200020057620001ff6200006b565b5b5f83015167ffffffffffffffff81111562000220576200021f6200006f565b5b6200022e85828601620001b5565b925050602083015167ffffffffffffffff8111156200025257620002516200006f565b5b6200026085828601620001b5565b9150509250929050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680620002b957607f821691505b602082108103620002cf57620002ce62000274565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302620003337fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620002f6565b6200033f8683620002f6565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f62000389620003836200037d8462000357565b62000360565b62000357565b9050919050565b5f819050919050565b620003a48362000369565b620003bc620003b38262000390565b84845462000302565b825550505050565b5f90565b620003d2620003c4565b620003df81848462000399565b505050565b5b818110156200040657620003fa5f82620003c8565b600181019050620003e5565b5050565b601f82111562000455576200041f81620002d5565b6200042a84620002e7565b810160208510156200043a578190505b620004526200044985620002e7565b830182620003e4565b50505b505050565b5f82821c905092915050565b5f620004775f19846008026200045a565b1980831691505092915050565b5f62000491838362000466565b9150826002028217905092915050565b620004ac826200026a565b67ffffffffffffffff811115620004c857620004c76200008b565b5b620004d48254620002a1565b620004e18282856200040a565b5f60209050601f83116001811462000517575f841562000502578287015190505b6200050e858262000484565b8655506200057d565b601f1984166200052786620002d5565b5f5b82811015620005505784890151825560018201915060208501945060208101905062000529565b868310156200057057848901516200056c601f89168262000466565b8355505b6001600288020188555050505b505050505050565b6111c380620005935f395ff3fe608060405234801561000f575f80fd5b50600436106100a7575f3560e01c8063395093511161006f578063395093511461016557806370a082311461019557806395d89b41146101c5578063a457c2d7146101e3578063a9059cbb14610213578063dd62ed3e14610243576100a7565b806306fdde03146100ab578063095ea7b3146100c957806318160ddd146100f957806323b872dd14610117578063313ce56714610147575b5f80fd5b6100b3610273565b6040516100c09190610add565b60405180910390f35b6100e360048036038101906100de9190610b8e565b610303565b6040516100f09190610be6565b60405180910390f35b610101610325565b60405161010e9190610c0e565b60405180910390f35b610131600480360381019061012c9190610c27565b61032e565b60405161013e9190610be6565b60405180910390f35b61014f61035c565b60405161015c9190610c92565b60405180910390f35b61017f600480360381019061017a9190610b8e565b610364565b60405161018c9190610be6565b60405180910390f35b6101af60048036038101906101aa9190610cab565b61039a565b6040516101bc9190610c0e565b60405180910390f35b6101cd6103df565b6040516101da9190610add565b60405180910390f35b6101fd60048036038101906101f89190610b8e565b61046f565b60405161020a9190610be6565b60405180910390f35b61022d60048036038101906102289190610b8e565b6104e4565b60405161023a9190610be6565b60405180910390f35b61025d60048036038101906102589190610cd6565b610506565b60405161026a9190610c0e565b60405180910390f35b60606003805461028290610d41565b80601f01602080910402602001604051908101604052809291908181526020018280546102ae90610d41565b80156102f95780601f106102d0576101008083540402835291602001916102f9565b820191905f5260205f20905b8154815290600101906020018083116102dc57829003601f168201915b5050505050905090565b5f8061030d610588565b905061031a81858561058f565b600191505092915050565b5f600254905090565b5f80610338610588565b9050610345858285610752565b6103508585856107dd565b60019150509392505050565b5f6012905090565b5f8061036e610588565b905061038f8185856103808589610506565b61038a9190610d9e565b61058f565b600191505092915050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6060600480546103ee90610d41565b80601f016020809104026020016040519081016040528092919081815260200182805461041a90610d41565b80156104655780601f1061043c57610100808354040283529160200191610465565b820191905f5260205f20905b81548152906001019060200180831161044857829003601f168201915b5050505050905090565b5f80610479610588565b90505f6104868286610506565b9050838110156104cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c290610e41565b60405180910390fd5b6104d8828686840361058f565b60019250505092915050565b5f806104ee610588565b90506104fb8185856107dd565b600191505092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f490610ecf565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361066b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066290610f5d565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107459190610c0e565b60405180910390a3505050565b5f61075d8484610506565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107d757818110156107c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c090610fc5565b60405180910390fd5b6107d6848484840361058f565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084290611053565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b0906110e1565b60405180910390fd5b6108c4838383610a49565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610947576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093e9061116f565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a309190610c0e565b60405180910390a3610a43848484610a4e565b50505050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610a8a578082015181840152602081019050610a6f565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610aaf82610a53565b610ab98185610a5d565b9350610ac9818560208601610a6d565b610ad281610a95565b840191505092915050565b5f6020820190508181035f830152610af58184610aa5565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610b2a82610b01565b9050919050565b610b3a81610b20565b8114610b44575f80fd5b50565b5f81359050610b5581610b31565b92915050565b5f819050919050565b610b6d81610b5b565b8114610b77575f80fd5b50565b5f81359050610b8881610b64565b92915050565b5f8060408385031215610ba457610ba3610afd565b5b5f610bb185828601610b47565b9250506020610bc285828601610b7a565b9150509250929050565b5f8115159050919050565b610be081610bcc565b82525050565b5f602082019050610bf95f830184610bd7565b92915050565b610c0881610b5b565b82525050565b5f602082019050610c215f830184610bff565b92915050565b5f805f60608486031215610c3e57610c3d610afd565b5b5f610c4b86828701610b47565b9350506020610c5c86828701610b47565b9250506040610c6d86828701610b7a565b9150509250925092565b5f60ff82169050919050565b610c8c81610c77565b82525050565b5f602082019050610ca55f830184610c83565b92915050565b5f60208284031215610cc057610cbf610afd565b5b5f610ccd84828501610b47565b91505092915050565b5f8060408385031215610cec57610ceb610afd565b5b5f610cf985828601610b47565b9250506020610d0a85828601610b47565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610d5857607f821691505b602082108103610d6b57610d6a610d14565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610da882610b5b565b9150610db383610b5b565b9250828201905080821115610dcb57610dca610d71565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f610e2b602583610a5d565b9150610e3682610dd1565b604082019050919050565b5f6020820190508181035f830152610e5881610e1f565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f610eb9602483610a5d565b9150610ec482610e5f565b604082019050919050565b5f6020820190508181035f830152610ee681610ead565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f610f47602283610a5d565b9150610f5282610eed565b604082019050919050565b5f6020820190508181035f830152610f7481610f3b565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f610faf601d83610a5d565b9150610fba82610f7b565b602082019050919050565b5f6020820190508181035f830152610fdc81610fa3565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f61103d602583610a5d565b915061104882610fe3565b604082019050919050565b5f6020820190508181035f83015261106a81611031565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6110cb602383610a5d565b91506110d682611071565b604082019050919050565b5f6020820190508181035f8301526110f8816110bf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f611159602683610a5d565b9150611164826110ff565b604082019050919050565b5f6020820190508181035f8301526111868161114d565b905091905056fea264697066735822122068e7088e2020b3a92aeb07338de801db3c8164bac57255e32c1c6a6614fdeabe64736f6c63430008150033`